package cn.jvav.zh.game;

import cn.jvav.zh.game.logic.Coord;

public class Hero{
	public int HP = 1000;
	public int ATK = 100;
	public int DEF = 100;
	public int money = 0;
	public String weapon = "神圣剑";
	public String shield = "神圣盾";
	public Coord coord = new Coord(5, 10);

	public Hero(){
	}

	public Hero(int HP, int ATK, int DEF, int money, String weapon, String shield, Coord coord){
		this.HP = HP;
		this.ATK = ATK;
		this.DEF = DEF;
		this.money = money;
		this.weapon = weapon;
		this.shield = shield;
		this.coord = coord;
	}

	public void showStatus(){
		System.out.println("生命:" + HP + " 攻击:" + ATK + " 防御:" + DEF + " 金币:" + money);
	}

	public void showEquip(){
		System.out.println("武器:" + weapon + " 防具:" + shield);
	}

	public void moveTo(Coord coord){
		if(coord.x >= 0 && coord.x < 11 && coord.y >= 0 && coord.y < 11){
			this.coord = coord;
		}
	}

	public void up(){
		Coord coord = new Coord(this.coord);
		--coord.y;
		moveTo(coord);
	}

	public void down(){
		Coord coord = new Coord(this.coord);
		++coord.y;
		moveTo(coord);
	}

	public void left(){
		Coord coord = new Coord(this.coord);
		--coord.x;
		moveTo(coord);
	}

	public void right(){
		Coord coord = new Coord(this.coord);
		++coord.x;
		moveTo(coord);
	}
}
